package shao.web;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import shao.domain.GeneralObjectResp;
import shao.entity.User;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping(value = "/user")
public class UserCntroller {


    @RequestMapping(value = "/all", method = RequestMethod.GET)
    @ResponseBody
    public Object getAllusers(){

        User user1=new User();
        user1.setAge("20");
        user1.setName("shaoshao");

        User user2=new User();
        user2.setAge("21");
        user2.setName("shaoshaoqi");
        List users=new ArrayList();
        users.add(user1);
        users.add(user2);

        return GeneralObjectResp.success(users);
    }
}
